import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/page/login'
import Index from '@/components/page/index'
import atten from '@/components/page/atten'
import author from '@/components/page/author'
import bigClass from '@/components/page/bigClass'
import member from '@/components/page/member'
import priceList from '@/components/page/priceList'
import sellList from '@/components/page/sellList'
import staff from '@/components/page/staff'
import stockList from '@/components/page/stockList'
import stockYj from '@/components/page/stockYj'
import storeList from '@/components/page/storeList'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {path: '/store/atten', name: 'atten', component: atten},
        {path: '/store/author', name: 'author', component: author},
        {path: '/store/member', name: 'member', component: member},
        {path: '/store/staff', name: 'staff', component: staff},
        {path: '/store/storeList', name: 'storeList', component: storeList},
        {path: '/goods/bigClass', name: 'bigClass', component: bigClass},
        {path: '/goods/priceList', name: 'priceList', component: priceList},
        {path: '/goods/sellList', name: 'sellList', component: sellList},
        {path: '/goods/stockList', name: 'stockList', component: stockList},
        {path: '/goods/stockYj', name: 'stockYj', component: stockYj},
        {
          path: '/store',
          redirect: '/store/storeList'
        },
        {
          path: '/goods',
          redirect: '/goods/bigClass'
        }
      ]
    },
    {
      path: '/index',
      redirect: '/'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    }
  ]
})
